package com.journey.org.ui.knowledge.play.list

import android.os.Bundle
import com.journey.org.entity.PlayProjectEntity
import com.journey.org.ui.web.WebActivity
import com.mvvmhabit.org.base.ItemViewModel
import com.mvvmhabit.org.binding.command.BindingAction
import com.mvvmhabit.org.binding.command.BindingCommand

/**
 * @Date: 2020/12/18 10:31
 * @Author:小妖
 * @Description: play Android 项目列表
 */
class PlayAndroidListItemViewModel(vm: PlayAndroidListViewModel, val entity: PlayProjectEntity) :
    ItemViewModel<PlayAndroidListViewModel>(vm) {

    val isVisible = "" != entity.envelopePic

    val onClickEnterDetailCommand = BindingCommand<Any>(object : BindingAction {
        override fun call() {
            val bundle = Bundle()
            bundle.putString("loadUrl", entity.link)
            bundle.putString("title", entity.title)
            viewModel.startActivity(WebActivity::class.java, bundle)
        }
    })

}